package com.xyz.study.design_mode.i_bridge.mode;


/**
 * role: Abstraction 功能抽象化
 * @author XYZ
 * @version 1.0.0
 * @since 2021/1/15
 */
public abstract class PrinterAbstraction {
    private PrinterImplementor printerImplementor;

    public PrinterAbstraction(PrinterImplementor printerImplementor) {
        this.printerImplementor = printerImplementor;
    }

    protected abstract String prefix();

    protected abstract String postfix();

    public void printAddress(){
        System.out.println(prefix());
        printerImplementor.printAddress(printerImplementor.findAddress());
        System.out.println(postfix());
    }
}
